package com.lanxiao.cloud.modules.oauth.application;

import com.lanxiao.cloud.common.web.invalid.Log;
import com.lanxiao.cloud.common.web.service.IContentParse;
import com.lanxiao.cloud.modules.oauth.infrastructure.repository.RoleMapper;
import org.springframework.stereotype.Component;

/**
 * @author ：qiaoliang
 * @date ：2021-10-19
 */
@Component
public class UserRoleContentParse implements IContentParse {

  private final RoleMapper roleMapper;

  public UserRoleContentParse(
      RoleMapper roleMapper) {
    this.roleMapper = roleMapper;
  }

  @Override
  public Object getResult(Object id, Log logs) {
    return roleMapper.findByUserRole(Long.valueOf(id.toString()));
  }

}
